﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucCart.ascx.cs" Inherits="Yumcha_UcControl_ucCart" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<style type="text/css">
    .style1
    {
        height: 47px;
    }
    #thanh
    {
        background-color: #C6A145;
        border-left: 3px solid green;
        color: white;
        font-weight: bold;
        line-height: 30px;
        padding-left: 20px;
    }
</style>
<asp:Panel ID="pnlViewCart" runat="Server">
    <asp:UpdatePanel ID="pnlShoppingCart" runat="server">
        <ContentTemplate>
            <table border="0" cellpadding="0" cellspacing="0" style="margin: 10px;">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td id="tdShoppingCart" runat="server" class="" style="padding-left: 10px">
                        </td>
                    </tr>
                    <caption>
                        You have
                        <asp:Label ID="lblNumber" runat="server" Font-Bold="true" ForeColor="#2088d8" Text="0 product" />
                        &nbsp;in cart. </td> </tr>
                        <tr>
                            <td style="padding-top: 10px;">
                                <asp:GridView ID="grdShoppingCart" runat="server" AutoGenerateColumns="False" CellPadding="10"
                                    CssClass="grd" OnRowDataBound="grdShoppingCart_RowDataBound">
                                    <Columns>
                                        <asp:TemplateField HeaderText="Product">
                                            <ItemTemplate>
                                                <asp:Image ID="imgProduct" runat="server" ImageUrl='<%# "~/ImageProcess.ashx?file=" + "~/Admin/img/ImageMenu/" + Eval("Menu.ImageURL") + "&width=90&heigh=90&dd=true" %>' />
                                            </ItemTemplate>
                                            <ItemStyle Height="100" HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Product Name">
                                            <ItemTemplate>
                                                <%# Eval("Menu.MenuName")%>
                                            </ItemTemplate>
                                            <ItemStyle Font-Bold="true" HorizontalAlign="Left" Width="265px" Wrap="True" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Price">
                                            <ItemTemplate>
                                                <asp:Label ID="lblPrice" runat="server" CssClass="clsPriceCart" Text='<%# Eval("Price") %>'></asp:Label>
                                                <asp:Label ID="lblMatchedPrice" runat="server" CssClass="clsPriceCartMatched" Text="0"></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="90" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Total">
                                            <ItemTemplate>
                                                <asp:UpdatePanel ID="updatePnlQuantity" runat="server">
                                                    <ContentTemplate>
                                                        <table border="0" cellpadding="0" cellspacing="0">
                                                            <tr>
                                                                <td style="padding: 4px 0 0 4px;">
                                                                    <asp:ImageButton ID="btnQuantityDn" runat="server" ImageUrl="~/images/quantityDn.png"
                                                                        OnClick="btnQuantity_Click" SkinID="btnDn" />
                                                                </td>
                                                                <td>
                                                                    &nbsp;
                                                                </td>
                                                                <td style="padding-top: 5px;">
                                                                    <asp:TextBox ID="txtQuantity" runat="server" AutoPostBack="true" CssClass="txtQuantity"
                                                                        OnTextChanged="txtQuantity_TextChanged" Text='<%# Eval("Quantity") %>' ToolTip='<%# Eval("Quantity") %>'
                                                                        Width="30" />
                                                                </td>
                                                                <td style="padding: 4px 0 0 4px;">
                                                                    <asp:ImageButton ID="btnQuantityUp" runat="server" ImageUrl="~/images/quantityUp.png"
                                                                        OnClick="btnQuantity_Click" SkinID="btnUp" />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td align="center" colspan="3" style="padding-top: 3px;">
                                                                    <asp:UpdateProgress ID="updatePnlProgress" runat="server" AssociatedUpdatePanelID="updatePnlQuantity"
                                                                        DynamicLayout="false">
                                                                        <ProgressTemplate>
                                                                            <asp:Image ID="imgUpdatingSmall" runat="server" ImageUrl="~/images/ajaxLoading.gif" />
                                                                        </ProgressTemplate>
                                                                    </asp:UpdateProgress>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </ContentTemplate>
                                                    <Triggers>
                                                        <asp:AsyncPostBackTrigger ControlID="txtQuantity" EventName="TextChanged" />
                                                        <asp:AsyncPostBackTrigger ControlID="btnQuantityDn" EventName="Click" />
                                                        <asp:AsyncPostBackTrigger ControlID="btnQuantityUp" EventName="Click" />
                                                    </Triggers>
                                                </asp:UpdatePanel>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="90px" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Quantity">
                                            <ItemTemplate>
                                                <asp:UpdatePanel ID="updatePnlGrid" runat="server">
                                                    <ContentTemplate>
                                                        <asp:Label ID="lblSubTotal" runat="server" CssClass="clsSubTotalPriceCart"></asp:Label>
                                                    </ContentTemplate>
                                                </asp:UpdatePanel>
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="100" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Delete">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="imgDelete" runat="server" ImageUrl="~/Yumcha/images/del.gif"
                                                    OnClick="imgDelete_Click" Style="display: block;" ToolTip="Xóa" />
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50" />
                                        </asp:TemplateField>
                                    </Columns>
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle CssClass="grdHeader" />
                                    <EditRowStyle BackColor="#2461BF" />
                                    <AlternatingRowStyle CssClass="grdAlternateRow" />
                                    <RowStyle CssClass="grdRow" />
                                </asp:GridView>
                            </td>
                        </tr>
                    </caption>
                </table>
                <asp:Panel ID="pnlCartFooter" runat="server" Height="191px" Width="100%" Style="margin: 5px auto 0">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td style="text-align: right" id="thanh">
                                <asp:Label ID="test_tong" runat="server" CssClass="clsTotalPriceCart"></asp:Label>
                                <span class="clsTotalPriceCart">Total Amount:</span>
                                <asp:Label ID="lblTotal" runat="server" CssClass="clsTotalPriceCart"></asp:Label>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="padding: 10px 0 10px 0; text-align: right;" class="style1">
                                <asp:Button ID="imgBtnCheckOut" runat="server" Style="color: white; border-radius: 8px 0 8px 0;
                                    padding: 6px; background: none repeat scroll 0px 0px rgb(198, 161, 69);" ToolTip="Check out"
                                    OnClick="imgBtnCheckOut_Click" Text="Checkout" />
                            </td>
                        </tr>
                        <tr>
                            <td style="padding: 10px 0 10px 0; text-align: right;">
                                <asp:Label ID="lblCheckOutInfo" runat="server" Text=""></asp:Label>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Panel>